package com.ess.system.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ess.system.service.dao.EssMenuDao;
import com.ess.system.service.model.EssMenu;

@RestController
@RequestMapping("/system/menu")
public class MenuServiceImpl implements MenuService
{
    @Autowired
    EssMenuDao essMenuDao;

    @RequestMapping("/menu")
    public String menu()
    {
        return "test...";
    }

    @RequestMapping("/add")
    public void add(EssMenu menu)
    {
        essMenuDao.save(menu);
    }

    @RequestMapping("/chindMenu")
    public List<EssMenu> chindMenu(long id)
    {
        return essMenuDao.findByParentId(id);
    }
}
